package com.itrus.util;

import java.io.InvalidObjectException;
import java.io.ObjectStreamException;
import java.text.MessageFormat;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.ResourceBundle;

public class KeyStoreType
{
  public static final KeyStoreType BKS;
  public static final KeyStoreType GKR;
  public static final KeyStoreType JCEKS = new KeyStoreType("JCEKS", true, false, new String[] { "jceks" });
  public static final KeyStoreType JKS = new KeyStoreType("JKS", true, false, new String[] { "jks" });
  public static final KeyStoreType PKCS11 = new KeyStoreType("PKCS11", false, false, new String[0]);
  public static final KeyStoreType PKCS12 = new KeyStoreType("PKCS12", false, true, new String[] { "p12", "pfx" });
  private static final LinkedHashMap TYPE_MAP;
  public static final KeyStoreType UBER;
  private static ResourceBundle m_res = ResourceBundle.getBundle("sun.security.util.Resources");
  private final boolean m_bCaseSensitive;
  private final boolean m_bCreationDate;
  private final String[] m_exts;
  private final String m_sType;

  static
  {
    BKS = new KeyStoreType("BKS", true, true, new String[] { "bks" });
    UBER = new KeyStoreType("UBER", true, true, new String[] { "ubr" });
    GKR = new KeyStoreType("GKR", true, true, new String[] { "gkr" });
    TYPE_MAP = new LinkedHashMap();
    TYPE_MAP.put(JKS.toString(), JKS);
    TYPE_MAP.put(PKCS12.toString(), PKCS12);
    TYPE_MAP.put(JCEKS.toString(), JCEKS);
    TYPE_MAP.put(BKS.toString(), BKS);
    TYPE_MAP.put(UBER.toString(), UBER);
    TYPE_MAP.put(GKR.toString(), GKR);
    TYPE_MAP.put(PKCS11.toString(), PKCS11);
  }

  public KeyStoreType(String paramString, boolean paramBoolean1, boolean paramBoolean2, String[] paramArrayOfString)
  {
    this.m_sType = paramString;
    this.m_bCreationDate = paramBoolean1;
    this.m_bCaseSensitive = paramBoolean2;
    this.m_exts = paramArrayOfString;
  }

  public static KeyStoreType getInstance(String paramString)
    throws CryptoException
  {
    KeyStoreType localKeyStoreType = (KeyStoreType)TYPE_MAP.get(paramString);
    if (localKeyStoreType == null)
      throw new CryptoException(MessageFormat.format(m_res.getString("NoResolveKeystoretype.exception.message"), new String[] { paramString }));
    return localKeyStoreType;
  }

  public static KeyStoreType[] getKnownTypes()
  {
    return (KeyStoreType[])TYPE_MAP.values().toArray(new KeyStoreType[TYPE_MAP.size()]);
  }

  private Object readResolve()
    throws ObjectStreamException
  {
    try
    {
      KeyStoreType localKeyStoreType = getInstance(this.m_sType);
      return localKeyStoreType;
    }
    catch (CryptoException localCryptoException)
    {
      throw new InvalidObjectException(localCryptoException.getMessage());
    }
  }

  public String[] getFilenameExtensions()
  {
    String[] arrayOfString = new String[this.m_exts.length];
    System.arraycopy(this.m_exts, 0, arrayOfString, 0, arrayOfString.length);
    return arrayOfString;
  }

  public boolean isCaseSensitive()
  {
    return this.m_bCaseSensitive;
  }

  public boolean supportsCreationDate()
  {
    return this.m_bCreationDate;
  }

  public String toPrettyString()
  {
    if (equals(PKCS11))
      return "PKCS #11";
    if (equals(PKCS12))
      return "PKCS #12";
    return toString();
  }

  public String toString()
  {
    return this.m_sType;
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.itrus.util.KeyStoreType
 * JD-Core Version:    0.6.2
 */